home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWMenu / FWAMnuIt.cpp next >
Encoding:
Text File  |  1996-09-17  |  2.1 KB  |  60 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWAMnuIt.cpp
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9. // We separate the archiving functions into their own translation units in order to
  10. // enable dead-stripping.
  11.  
  12. #include "FWOS.hpp"
  13.  
  14. #ifndef FWMNUITM_H
  15. #include "FWMnuItm.h"
  16. #endif
  17.  
  18. //========================================================================================
  19. // File scope definitions
  20. //========================================================================================
  21.  
  22. #ifdef FW_BUILD_MAC
  23. #pragma segment fwmenu
  24. #endif
  25.  
  26. //========================================================================================
  27. //    class FW_CMenuItem
  28. //========================================================================================
  29.  
  30. const FW_ClassTypeConstant FW_LMenuItem = FW_TYPE_CONSTANT('m','n','i','t');
  31. FW_REGISTER_ARCHIVABLE_CLASS(FW_LMenuItem, FW_CMenuItem, FW_CMenuItem::Read, 0, 0, FW_CMenuItem::Write)
  32.  
  33. //----------------------------------------------------------------------------------------
  34. //    FW_CMenuItem::Read
  35. //----------------------------------------------------------------------------------------
  36. // Maybe it would be better to simply not define this function at all, and pass 0 to
  37. // FW_REGISTER_ARCHIVABLE_CLASS above.
  38.  
  39. void* FW_CMenuItem::Read(FW_CReadableStream& stream, FW_ClassTypeConstant type)
  40. {
  41. FW_UNUSED(stream);
  42. FW_UNUSED(type);
  43.  
  44.     FW_DEBUG_MESSAGE("FW_CMenuItem::Read should never have been called");
  45.     return NULL;
  46. }
  47.  
  48. //----------------------------------------------------------------------------------------
  49. //    FW_CMenuItem::Write
  50. //----------------------------------------------------------------------------------------
  51.  
  52. void FW_CMenuItem::Write(FW_CWritableStream& stream, FW_ClassTypeConstant type, const void *object)
  53. {
  54. FW_UNUSED(type);
  55.     FW_SOMEnvironment ev;
  56.     FW_CMenuItem* menuItem = (FW_CMenuItem*)object;
  57.     menuItem->Flatten(ev, stream);
  58. }
  59.  
  60.